#ifndef VISUALIZATION_H_INCLUDED
#define	VISUALIZATION_H_INCLUDED
#include <string>
#include <vector>

#include <rfftw.h>              //the numerical simulation FFTW library
#include "ColorLegend.h"
#include "ColorMap.h"

class Simulation;

class Visualization
{
	friend class Application;
    
        ColorLegend d_legend;
        ColorMap d_map;
        
	
	public:
		
		Visualization();
		void visualize(Simulation const &simulation, int winWidth, int winHeight);
		
		//different types of color mapping: black-and-white, rainbow, banded
		enum ColorMode
		{
			BlackWhite,		
			Rainbow,
			Banded,
			ColorModeCount				// (automatically assigned)
		};
                
                enum DataSet
                {
                    Density,
                    Velocity,
                    Force,
                    DataSetCount
                };
                
		
		enum Option
		{
			DrawSmoke,				// draw the smoke or not
			DrawVectorField,		// draw the vector field or not
			UseDirectionColoring,	// use direction color-coding or not
			OptionsCount			// (automatically assigned)
		};
		
		void toggle(Option option);
		void enable(Option option);
		void disable(Option option);
		bool is_enabled(Option option) const;		
		void scale_hedgehogs(float scale);
		float hedgehog_scale() const;
                void setColorMode(int colorMode);
                void setDataSet(int dataSet);
		
//		void rainbow(float value, float* R, float* G, float* B);
		void set_colormap(float vy);
                
		void direction_to_color(float x, float y, int method);
		
	private:
		float get_datapoint(Simulation const &simulation, int idx);
		float vec_scale;				// scaling of hedgehogs 
		int options[OptionsCount];		// options boolean array                
		int scalar_col;			//method for scalar coloring
        std::vector<std::string> colormodes;
        std::vector<std::string> datasets;
        DataSet d_dataset;
};

#endif
